<?php
/*
  $Id: languages.php,v 1.15 2003/06/09 22:10:48 hpdl Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/

$width_banner = "100%";
$height_banner = "100%";
$banner_query = tep_db_query("select banners_id, banners_title, banners_image from " . TABLE_BANNERS . " where status = '1' and banners_group = 'homepage'");
$banner_rows = tep_db_num_rows($banner_query);
if ($banner_rows) {
?>
	<table cellspacing="0" cellpadding="0" border="0" >	
		<tr>
		    <td width="5" height="5"><?=tep_image(DIR_WS_IMAGES.'q3.gif')?><br></td>
		    <td width="<?=$width_banner?>" height="5" class="bg1"></td>
			<td width="5" height="5"><?=tep_image(DIR_WS_IMAGES.'q4.gif')?><br></td>
		</tr>
	<?php
		while ($banner = tep_db_fetch_array($banner_query)) {
			$array_banner_name = explode('.', $banner['banners_image']);
			$banner_type = $array_banner_name[sizeof($array_banner_name) - 1];
			switch ($banner_type) {
				case 'swf' :
	?>
					<tr>
						<td width="5" height="<?=$height_banner?>" class="bg4"></td>
						<td><embed height="<?=$height_banner?>" width="<?=$width_banner?>" name="plugin" src="<?=DIR_WS_IMAGES.$banner['banners_image']?>" type="application/x-shockwave-flash"/></td>
						<td width="5" height="<?=$height_banner?>" class="bg2"></td>
					</tr>					
	<?php
					break;
				case 'gif' :
				case 'jpg' :
				case 'jpeg' :
				case 'png' : 
	?>
					<tr>
						<td width="5" height="<?=$height_banner?>" class="bg4"></td>
						<td align="center" style="vertical-align:middle" height="<?=$height_banner?>"><?=tep_image(DIR_WS_IMAGES.$banner['banners_image'], $banner['banners_title'])?></td>
						<td width="5" height="<?=$height_banner?>" class="bg2"></td>
				    </tr>					
	<?php
					break;
	?>							
<?php 
			}
		}
?>
		<tr>
			<td width="5" height="5"><?=tep_image(DIR_WS_IMAGES.'q6.gif')?><br></td>
			<td width="548" height="5" class="bg3"></td>
			<td width="5" height="5"><?=tep_image(DIR_WS_IMAGES.'q5.gif')?><br></td>
		</tr>
	</table><br style="line-height:1px;"><br style="line-height:5px;">	
<?php
}
?>
			


